import 'package:get/get_navigation/src/routes/default_route.dart';
import 'package:get/get_navigation/src/routes/get_route.dart';
import 'package:get/get_rx/src/rx_types/rx_types.dart';
import 'package:test1/xykk/home/home_bind.dart';
import '../model/UserModel.dart';
import 'home_page.dart';

class HomeArgs{
  final UserModel userModel;
  final Rx<UserModel> rxUserModel;
  HomeArgs(this.userModel,this.rxUserModel);

  @override
  String toString() {
    return 'HomeArgs{userModel: $userModel}';
  }
}

class HomeConf{
  static final GetPage getPage = GetPage(
    name: '/xykk/home',
    page: () => const HomePage(),
    binding: HomeBinding(),
    // middlewares: [AuthMiddleware()]
  );

  static GetPageRoute? _pageRoute;

  /// 用于代码进行页面导航
  /// `Get.to()`
  // static Widget? getWidget(BuildContext context) {
  //   if (_pageRoute == null) {
  //     _pageRoute = getPage.createRoute(context) as GetPageRoute?;
  //   }
  //   return _pageRoute?.buildPage(context, null, null);
  // }

  /// 销毁创建的Page
  static void dispose() {
    _pageRoute?.dispose();
    _pageRoute = null;
  }
}
